package com.alter.zhang.userprovider.config.mybatis;

import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

@Configuration
public class MySqlSession {


    @Resource(name = "sqlSessionFactory")
    private SqlSessionFactory sqlSessionFactory;



    @Bean(name = "sqlSession")
    public SqlSessionTemplate sqlSessionFactory() {
        return new SqlSessionTemplate(sqlSessionFactory);
    }


}
